//
//  JYSearchModel.m
//  JYFarm
//
//  Created by 花花 on 2017/10/20.
//  Copyright © 2017年 花花. All rights reserved.
//

#import "JYSearchModel.h"

@implementation JYSearchModel
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.ID forKey:@"ID"];
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:@(self.nameWidth) forKey:@"nameWidth"];
    
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    
    if (self)
    {
        self.ID = [aDecoder decodeObjectForKey:@"ID"];
//        [[aDecoder decodeObjectForKey:@"ID"] longValue];
        
        self.name = [aDecoder decodeObjectForKey:@"name"];
        
        self.nameWidth = [[aDecoder decodeObjectForKey:@"nameWidth"] floatValue];
    }
    
    return self;
}


+ (instancetype)initWithName:(NSString *)name{

    JYSearchModel *model = [[JYSearchModel alloc]init];
    model.name = name;
    return model;
}

@end
